var mongoose = require("mongoose");
var Schema = mongoose.Schema;
var User = new Schema({
    username   : String,
    pwd        : String,
    age        : Number,
    create_date: { type: Date, default: Date.now }
});
var Product = new Schema({
    goods_name: String,
    goods_name_color: String,
    goods_name_style: String,
    goods_sn: String,
    is_best: Boolean,
    is_new: Boolean,
    is_hot: Boolean,
    is_on_sale: Boolean,
    serial: Number,
    flag: Boolean,
    shop_price: Number,
    virtual_sales: Number,
    goods_number: Number,
    create_date: { type: Date, default: Date.now }
});
// 创建model对象
var UserModel = mongoose.model('user', User);
var ProModel = mongoose.model('product',Product);
// 公开对象，暴露接口
module.exports = {
	UserModel : UserModel,
	ProModel : ProModel
}